package adapter;

import java.util.ArrayList;

import model.AdInfo;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import csf.getmoney.R;

public class CouponListAdapter extends BaseAdapter {
	Context context;
	ArrayList<AdInfo> couponList = new ArrayList<AdInfo>();
	LayoutInflater sa;

	public CouponListAdapter(Context context, ArrayList<AdInfo> couponList) {
		this.context = context;
		this.sa = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		this.couponList = couponList;

	}

	@Override
	public int getCount() {
		return 100;
	}

	@Override
	public AdInfo getItem(int arg0) {
		return couponList.get(arg0);
	}

	@Override
	public long getItemId(int position) {
		return getItem(position).getAd_Seq();
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			convertView = sa.inflate(R.layout.adapter_coupon_list, null);
		}
		
		return convertView;
	}

}
